fix: rank unknown buckets by client position#121
Conversation
Greptile SummaryRemoves the fixed 5000-point
Confidence Score: 4/5Safe to merge; the change is a single-function tweak with comprehensive test coverage of the new ordering semantics. The implementation is minimal and correct — removing one constant and one addition, with no risk of underflow or misuse. All affected test scenarios are updated and the new behavior (unknown buckets scored by position only) is exercised from multiple angles. The one thing worth keeping in mind is that test_regional_bucket_ordering_preserved now relies on an exact arithmetic tie (200 ms observed latency = 1 × POSITION_PENALTY = 2000 pts), so the test is marginally more load-bearing than it appears at first glance, but the ExponentialDecayHistogram mean for 10 identical 200 ms samples will always truncate to exactly 2000 integer points. src/object_store/stats.rs — the new score tie in test_regional_bucket_ordering_preserved warrants a second read to confirm the chosen 200 ms value is deliberately pinned to POSITION_PENALTY. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["score(now, bucket, idx)"] --> B{"by_bucket.get(bucket)"}
B -- "None (unknown)" --> C["score = idx × 2000"]
B -- "Some(stats)" --> D["Acquire Mutex lock"]
D --> E["lat = mean_latency_µs / 100"]
D --> F{"consecutive_failures ≥ 5?"}
F -- "Yes" --> G["err = 1_000_000 (circuit open)"]
F -- "No" --> H["err = error_rate × 100_000"]
E --> I["score = idx×2000 + err + lat"]
G --> I
H --> I
style C fill:#ffd700,stroke:#b8860b
style G fill:#ff6b6b,stroke:#cc0000
Reviews (1): Last reviewed commit: "fix: rank unknown buckets by client posi..." | Re-trigger Greptile |
## 🤖 New release * `cachey`: 0.10.10 -> 0.10.11 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.10.11](0.10.10...0.10.11) - 2026-06-10 ### Fixed - rank unknown buckets by client position ([#121](#121)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
Tests